<?php
if (isset($_SESSION['uid']) && isset($_POST['idcard']) && !empty($_POST['idcard'])){
    include '../c/config.php';
    $uid=$_SESSION['uid'];

    
    $mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
    if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqliTwo->error);}
    $idcard=addslashes(trim($_POST['idcard'])); 
    $phone=addslashes(trim($_POST['phone'])); 
    if (isset($_SESSION['openid'])) {
        $mysqli->query("update `app_student` set idcard='".$idcard."', phone='".$phone."',openid='".$_SESSION['openid']."' where id='".$uid."' ");
    }else{
    	$mysqli->query("update `app_student` set idcard='".$idcard."', phone='".$phone."' where id='".$uid."' ");
    }
  
    echo json_encode(array('status'=>'ok'));
    
     
    
}
